import Vue from 'vue'
import Router from 'vue-router'

let Home = () => import('@/components/Home')
let Dashboard = () => import('@/components/children/Dashboard')
let Icons = () => import('@/components/children/Icons')
let Maps = () => import('@/components/children/Maps')
let Notifications = () => import('@/components/children/Notifications')
let Tablelist = () => import('@/components/children/Tablelist')
let Typography = () => import('@/components/children/Typography')
let Userprofile = () => import('@/components/children/Userprofile')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect:'/home/dashboard',
      meta:{
        keepAlive:true
      },
      children: [
        {
          path: '/home/dashboard',
          name: 'Dashboard',
          component: Dashboard
        },
        {
          path: '/home/userprofile',
          name: 'Userprofile',
          component: Userprofile
        },
        {
          path: '/home/tablelist',
          name: 'Tablelist',
          component: Tablelist
        },
        {
          path: '/home/typography',
          name: 'Typography',
          component: Typography
        },
        {
          path: '/home/icons',
          name: 'Icons',
          component: Icons
        },
        {
          path: '/home/maps',
          name: 'Maps',
          component: Maps,
          meta:{
            keepAlive:true
          }
        },
        {
          path: '/home/notifications',
          name: 'Notifications',
          component: Notifications
        }
      ]
    }
  ]
})
